import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:sp_util/sp_util.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBNetWorkModule/YBAPi/YBDioUtils.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBUtils/YBBaseUtils/YBCallPhoneUtils.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBUtils/YBBaseUtils/YBisLoginUtils.dart';

class YBWorkTaiInfoShowVipPage {



  static void showWorkTaiInfoVipPage(BuildContext context,{String titleStr}){
    showDialog(context:context, builder:(BuildContext context){
      return Dialog(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(ScreenUtil.getInstance().getAdapterSize(16))),
        ),
        child: Container(
          height: ScreenUtil.getInstance().getAdapterSize(250),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Container(
                child: Padding(
                  padding: EdgeInsets.only(left: ScreenUtil.getInstance().getAdapterSize(20),top: ScreenUtil.getInstance().getAdapterSize(24),right:ScreenUtil.getInstance().getAdapterSize(20)),
                  child: Container(
                    child: Row(
                      children: [
                        Container(
                          child: Image.asset(YBImageStyle.getImagePath('popTanView_biaoqingInfo'),width: ScreenUtil.getInstance().getAdapterSize(40),height: ScreenUtil.getInstance().getAdapterSize(40),),
                        ),
                        Container(
                          width: ScreenUtil.getInstance().getAdapterSize(15),
                        ),
                        Container(
                          child: Text('很抱歉，您的权限不足',style:TextStyle(
                            color: YBColor.color181818,
                            fontSize: ScreenUtil.getInstance().getAdapterSize(20.0),
                            fontWeight: FontWeight.w500,
                          ),),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
              Expanded(
                // color: YBColor.white,
                child: Padding(
                  padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().getAdapterSize(20), ScreenUtil.getInstance().getAdapterSize(20), 0,ScreenUtil.getInstance().getAdapterSize(20)),
                  child: Container(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          height: 8,
                        ),
                        Container(
                          child: Container(
                            child: Text(titleStr??"",style:TextStyle(
                              color: YBColor.color303133,
                              fontWeight: FontWeight.normal,
                              fontSize: ScreenUtil.getInstance().getAdapterSize(16.0),
                            ),),
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
              Container(
                child: Container(
                  height: ScreenUtil.getInstance().getAdapterSize(56.0),
                  child: FlatButton(
                      shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.only(bottomLeft: Radius.circular(ScreenUtil.getInstance().getAdapterSize(16.0)),bottomRight: Radius.circular(ScreenUtil.getInstance().getAdapterSize(16)))
                      ),
                      color: YBColor.commonThemeColor,
                      child: Text('申请加入',style: YBTextStyle.TextStyleFFFFFF14Sembold,),
                      onPressed:() async {
                        YBCallPhoneUtils().getCallPhoneUtils("tel:4008260272");
                        YBNavigatorUtil.goDefaultBack(context);
                      }),
                ),
              ),
            ],
          ),
        ),
      );
    });
  }


  static void showWorkTainmishuTongVipPage(BuildContext context){
    showDialog(context:context, builder:(BuildContext context){
      return Dialog(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(ScreenUtil.getInstance().getAdapterSize(16.0))),
        ),
        child: Container(
          height: ScreenUtil.getInstance().getAdapterSize(256.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Container(
                child: Padding(
                  padding: EdgeInsets.only(left: ScreenUtil.getInstance().getAdapterSize(20.0),top: ScreenUtil.getInstance().getAdapterSize(24.0)),
                  child: Container(
                    child: Row(
                      children: [
                        Container(
                          child: Image.asset(YBImageStyle.getImagePath('popTanView_biaoqingInfo'),width: ScreenUtil.getInstance().getAdapterSize(40.0),height: ScreenUtil.getInstance().getAdapterSize(40.0),),
                        ),
                        Container(
                          width: 15,
                        ),
                        Container(
                          child: Text('很抱歉，您的权限不足',style:TextStyle(
                            fontSize: ScreenUtil.getInstance().getAdapterSize(20.0),
                            color: YBColor.color181818,
                            fontWeight: FontWeight.w500,
                          ),),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
              Expanded(
                // color: YBColor.white,
                child: Padding(
                  padding: EdgeInsets.fromLTRB(10, 20, 0, 20),
                  child: Container(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Container(
                          child: Text(
                            "您可能:",
                            style: TextStyle(
                              fontWeight: FontWeight.w500,
                              color: YBColor.color303133,
                              fontSize: ScreenUtil.getInstance().getAdapterSize(16)
                            ),
                          ),
                        ),
                        Container(
                          height: 8,
                        ),
                        Container(
                          child:Column(
                            mainAxisAlignment: MainAxisAlignment.start,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Container(
                                child: Text('1、还没有成为蚁集网严选商家',style:TextStyle(
                                  fontSize: ScreenUtil.getInstance().getAdapterSize(12.0),
                                  fontWeight: FontWeight.normal,
                                  color: YBColor.color303133,
                                ),),
                              ),
                              Container(
                                height: 8,
                              ),
                              Container(
                                child: Text('2、还没有成为今日律司牛律师',style:TextStyle(
                                  fontSize: ScreenUtil.getInstance().getAdapterSize(12.0),
                                  fontWeight: FontWeight.normal,
                                  color: YBColor.color303133,
                                ),),
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
              Container(
                child: Container(
                  height: ScreenUtil.getInstance().getAdapterSize(56.0),
                  child: FlatButton(
                      shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.only(bottomRight: Radius.circular(ScreenUtil.getInstance().getAdapterSize(16.0)),bottomLeft: Radius.circular(ScreenUtil.getInstance().getAdapterSize(16.0))),
                      ),
                      color: YBColor.commonThemeColor,
                      child: Text('申请评定',style: YBTextStyle.TextStyleFFFFFF14Sembold,),
                      onPressed:() async {
                        YBCallPhoneUtils().getCallPhoneUtils("tel:4008260272");
                        YBNavigatorUtil.goDefaultBack(context);
                      }),
                ),
              ),
            ],
          ),
        ),
      );
    });
  }


  static void showLoginOutPage(BuildContext context){
    showDialog(context:context, builder:(BuildContext context){
      return Dialog(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(ScreenUtil.getInstance().getAdapterSize(16.0))),
        ),
        child: Container(
          height: ScreenUtil.getInstance().getAdapterSize(170),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Container(
                child: Padding(
                  padding: EdgeInsets.only(left:ScreenUtil.getInstance().getAdapterSize(20),top: ScreenUtil.getInstance().getAdapterSize(10),right: ScreenUtil.getInstance().getAdapterSize(20)),
                  child: Container(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          child: Text('提示',style: YBTextStyle.TextStyle18181812Medium,),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
              Expanded(
                // color: YBColor.white,
                child: Padding(
                  padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().getAdapterSize(20), 0, ScreenUtil.getInstance().getAdapterSize(20)),
                  child: Container(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          child: Text(
                            "确定退出登录？",
                            style: YBTextStyle.TextStyle18181814Medium,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
              Container(
                child:Row(
                  children: [
                    Expanded(
                      child:Container(
                        height: ScreenUtil.getInstance().getAdapterSize(56),
                        child: FlatButton(
                            shape: RoundedRectangleBorder(
                                 borderRadius: BorderRadius.only(bottomLeft: Radius.circular(16.0)),
                            ),
                            color: YBColor.white,
                            child: Text('取消',style: YBTextStyle.TextStyle18181814Medium,),
                            onPressed:() async {
                              YBNavigatorUtil.goDefaultBack(context);
                            }),
                      ),
                    ),
                    Expanded(
                      child:Container(
                        height: ScreenUtil.getInstance().getAdapterSize(56),
                        child: FlatButton(
                            shape: RoundedRectangleBorder(
                              borderRadius: BorderRadius.only(bottomRight: Radius.circular(ScreenUtil.getInstance().getAdapterSize(16.0))),
                            ),
                            color: YBColor.commonThemeColor,
                            child: Text('确定',style: YBTextStyle.TextStyleFFFFFF14Sembold,),
                            onPressed:() async {
                              SpUtil.remove('token');
                              SpUtil.remove("VIP");
                              YBDioUtils.clear();
                              YBisLoginUtils.logOut().then((value){
                                if (value == true) {
                                  YBNavigatorUtil.goToHomeRemovePage(context);
                                }
                              });
                            }),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      );
    });
  }

}